package com.zyf.EasyNet.param.state.impl;

import com.zyf.EasyNet.param.state.Code;
import com.zyf.EasyNet.param.state.Message;
import org.springframework.stereotype.Component;

/**
 * @first_author zyflzz
 * @gmt_created 2022/6/3
 * @gmt_modified 2022/6/3
 */
@Component
public class CodeImpl implements Code {
    @Override
    public String  Message(int code) {
        switch (code){
            case Code.USERNAME_NULL:
                return Message.USERNAME_NULL;
            case Code.PWD_NULL:
                return Message.PWD_NULL;
            case Code.USER_ALREADY_EXIST:
                return Message.USER_ALREADY_EXIST;
            case Code.USER_NOT_EXIST:
                return Message.USER_NOT_EXIST;
            case Code.USERNAME_OR_PWD_WRONG:
                return Message.USERNAME_OR_PWD_WRONG;
            case Code.LOGIN_SUCCESS:
                return Message.LOGIN_SUCCESS;
            case Code.SIGN_SUCCESS:
                return Message.SIGN_SUCCESS;
            default:
                return "";
        }
    }
}
